import java.io.IOException;
import java.nio.ByteBuffer;

public class ConnectorHandler extends Connector {
    public ConnectorHandler() {
        super(false);
    }

    public void writeMessage(byte[] bytes){
        ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
        writeMessage(byteBuffer);
        byteBuffer.clear();
    }
    public void writeMessage(ByteBuffer byteBuffer) {
        if (super.getSocketChannel() != null && super.getSocketChannel().isOpen()) {
            try {
                super.getSocketChannel().write(byteBuffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void close() throws IOException {

    }
}
